package com.gzdh.tang.modu.model;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class DeviceCarModel {


    private int resultCode;

    private int addr;

    private String posNum;

    private String operaId;

    private String addrName;

    private String orders;

    private String liushui;

    private BigDecimal amountPrice;

    private BigDecimal amountCount;

    private String payChannelName;

    private String cardsn;

    private List<CarFoodsModel> carFoods;

    public BigDecimal getAmountPriceSum() {
        BigDecimal price = new BigDecimal(0);
        for (CarFoodsModel goo : carFoods) {
            price = price.add(new BigDecimal(goo.getFoodNumber()).multiply(new BigDecimal(goo.getPrice())));

        }
        this.amountPrice = price;
        return price;
    }

}
